package com.zh.note.huawei.onehundred.数列描述数列还原;

import java.util.Scanner;

/**
 * @Author: zhanghuan
 * @date: 2023/9/4 17:12
 * @description: create it
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        StringBuilder content = new StringBuilder("1");
        if (n == 0) {
            System.out.println(content.toString());
            return;
        }
        for (int i = 1; i <= n; i++) {
            StringBuilder next = new StringBuilder();
            char[] chars = content.toString().toCharArray();
            char pre = chars[0];
            int count = 1;
            for (int j = 1; j < chars.length; j++) {
                if (chars[j] == pre) {
                    count++;
                } else {
                    next.append(count).append(pre);
                    count = 1;
                    pre = chars[j];
                }
            }
            next.append(count).append(pre);
            content = next;
        }
        System.out.println(content);

    }
}
